

//
//  Book.m
//  03-homework
//
//  Created by dllo on 16/7/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Book.h"

@implementation Book
- (instancetype)initWithName:(NSString *)name price:(float)price {
    self = [super init];
    if (self) {
        _bookName = name;
        _price = price;
    }
    return self;
}
+ (instancetype)bookWithName:(NSString *)name price:(float)price {
    return [[Book alloc] initWithName:name price:price];
}
- (NSString *)description{
    return [NSString stringWithFormat:@"书名:%@ 价格为:%lf", self.bookName, self.price];

}
@end
